Skip to content

Gate Metro connectivity on RCT_DEV_MENU instead of RCT_DEV#57080

Closed
fmacinator wants to merge 1 commit into
react:mainfrom
fmacinator:export-D107524388
Closed

Gate Metro connectivity on RCT_DEV_MENU instead of RCT_DEV#57080
fmacinator wants to merge 1 commit into
react:mainfrom
fmacinator:export-D107524388

Conversation

@fmacinator

Copy link
Copy Markdown
Contributor

Summary:
When an iOS app is built with the React Native dev menu enabled (RCT_DEV_MENU=1) but RCT_DEV=0, the "Change Bundle Location" option can be visible while the Metro connection path remains compiled out. This makes the setting ineffective.

This gates the Metro host override path on RCT_DEV_MENU instead of RCT_DEV, matching the flag that controls whether the dev menu exists. Auto-discovery via guessPackagerHost remains behind RCT_DEV because it is a development convenience for full dev builds. Builds that do not set RCT_DEV_MENU=1 keep the same preprocessor output because RCT_DEV_MENU defaults to RCT_DEV.

Changelog:
[iOS][Fixed] - Allow iOS apps with the dev menu enabled (RCT_DEV_MENU) to connect to Metro via "Change Bundle Location"

Differential Revision: D107524388

Summary:
When an iOS app is built with the React Native dev menu enabled (`RCT_DEV_MENU=1`) but `RCT_DEV=0`, the "Change Bundle Location" option can be visible while the Metro connection path remains compiled out. This makes the setting ineffective.

This gates the Metro host override path on `RCT_DEV_MENU` instead of `RCT_DEV`, matching the flag that controls whether the dev menu exists. Auto-discovery via `guessPackagerHost` remains behind `RCT_DEV` because it is a development convenience for full dev builds. Builds that do not set `RCT_DEV_MENU=1` keep the same preprocessor output because `RCT_DEV_MENU` defaults to `RCT_DEV`.

Changelog:
[iOS][Fixed] - Allow iOS apps with the dev menu enabled (`RCT_DEV_MENU`) to connect to Metro via "Change Bundle Location"

Differential Revision: D107524388
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2026
@meta-codesync

meta-codesync Bot commented Jun 4, 2026

Copy link
Copy Markdown

@fmacinator has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107524388.

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 4, 2026
@meta-codesync meta-codesync Bot closed this in 94380cb Jun 5, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Jun 5, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @fmacinator in 94380cb

When will my fix make it into a release? | How to file a pick request?

@meta-codesync

meta-codesync Bot commented Jun 5, 2026

Copy link
Copy Markdown

This pull request has been merged in 94380cb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants